import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/home",
    component: () => import("@/views/home/indexView"),
  },
  {
    path: "/Cart",
    component: () => import("@/views/Cart/CartView"),
    props: true,
  },
  {
    path: "/my",
    component: () => import("@/views/my/MyView"),
  },
  {
    path: "/buy/:id",
    component: () => import("@/views/buy/buygoodView"),
    props: true,
  },
  {
    path: "/Goods",
    component: () => import("@/views/Goods/GoodsView"),
  },

  {
    path: "/goodItemxq/:id",
    component: () => import("@/views/Goods/components/goodItemxq"),
    props: true,
  },

  {
    //路由重定向
    path: "/",
    redirect: "/home",
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
